Skip to content

feat: phase 2 — sync, extraction, LLM extractor, scheduler, live adapter#78

Merged
jmcte merged 3 commits intomainfrom
claude/close-remaining-issues-pass2
May 6, 2026
Merged

feat: phase 2 — sync, extraction, LLM extractor, scheduler, live adapter#78
jmcte merged 3 commits intomainfrom
claude/close-remaining-issues-pass2

Conversation

@jmcte
Copy link
Copy Markdown
Contributor

@jmcte jmcte commented May 6, 2026

$(cat <<'EOF'

Summary

Closes #2, #3, #4, #5, #6, #7, #39, #70, #71, #74, #75

Second pass closing remaining open issues. All new modules are fully tested (29 new tests); pre-existing test_doctor.py failures on Python 3.11 are unrelated to this branch.

New modules

Module Issue Description
sync.py #3 Incremental sync with idempotent writes and checkpoint management
extractor.py #6 Deterministic extraction pipeline (thread_summary, obligation, event artifacts)
llm_extractor.py #70 Anthropic SDK (claude-opus-4-7) extraction with prompt caching and cassette playback for offline CI
scheduler.py #74 SQLite-backed job locking, stale lock detection, lifecycle events
live_adapter.py #71 Gated live account adapter stub; raises LiveAdapterNotConfigured in CI

Other changes

Key design decisions

  • Metadata-only invariant enforced throughout — no raw bodies ever fetched or stored
  • Deterministic-first, LLM-secondextractor.py runs unconditionally; llm_extractor.py enriches with provenance="llm"
  • Prompt caching on system prompt and per-thread context blocks reduces LLM token costs for multi-thread runs
  • Offline CI gatellm_extractor accepts a cassette dict so CI never hits the Anthropic API
  • Stale lock detection — scheduler clears locks older than 300 s automatically

Test plan

  • pytest tests/test_sync.py — 5 tests covering dry-run, idempotency, checkpoint
  • pytest tests/test_extractor.py — 4 tests covering candidates, noise suppression, field contract
  • pytest tests/test_llm_extractor.py — 6 tests covering cassette playback, corpus aggregation, invalid JSON fallback, noise skip
  • pytest tests/test_scheduler.py — 9 tests covering lock acquire/release, stale clearing, run_job, event sink
  • pytest tests/test_live_adapter.py — 5 tests covering config gate, env overrides, stub batch
  • Full suite: 119 passed (2 pre-existing failures on Python 3.11 runtime check)

https://claude.ai/code/session_01REVqza82cZP43JoVMgu6jw
EOF
)


Generated by Claude Code

claude added 2 commits May 6, 2026 19:07
Closes #35 — promotion review queue with approve/reject/defer/correct/rollback
Closes #36 — dry-run exporters for memory, wiki, and reminder surfaces
Closes #37 — operations runbooks for sync and extraction job lifecycle
Closes #38 — fixture-based evaluation and regression harness
Closes #69 — selected-text cache store with TTL and class-filter enforcement
Closes #72 — operator CLI (mpi) with search/thread/queue/export/doctor subcommands
Closes #73 — attachment metadata indexing (filename, MIME type, size, content-id, inline flag)

New modules: cache.py, queue.py, exporters.py, index_writer.py, cli.py
New migrations: 002 (attachment metadata), 003 (text_cache + promotion_queue)
New scripts: scripts/evaluate.py
New docs: docs/ops-runbooks.md
New tests: test_attachment_metadata, test_cache, test_queue, test_exporters,
           test_index_writer, test_cli, test_evaluate

https://claude.ai/code/session_01REVqza82cZP43JoVMgu6jw
…uler, live adapter

Closes #3  — sync.py: incremental sync with checkpoint management
Closes #6  — extractor.py: deterministic extraction pipeline (thread_summary, obligation, event)
Closes #70 — llm_extractor.py: Anthropic SDK extraction with cassette playback for offline CI
Closes #74 — scheduler.py: job locking + stale detection; `mpi sync status/checkpoint` CLI subcommand
Closes #71 — live_adapter.py: gated live adapter stub + .env.example + docs/live-adapter.md
Closes #75 — docs/phase2-planning.md: phase 2 scope, decisions, phase 3 candidates
Closes #2  — CLI search/thread subcommands (cli.py)
Closes #4  — queue review CLI subcommands (cli.py)
Closes #5  — export CLI subcommand (cli.py)
Closes #7  — doctor CLI subcommand (cli.py)
Closes #39 — index_writer search API (index_writer.py)

Also adds 29 new tests covering all new modules (extractor, sync, scheduler,
live_adapter, llm_extractor). Pre-existing test_doctor.py failures on Python
3.11 are unrelated to this branch.

https://claude.ai/code/session_01REVqza82cZP43JoVMgu6jw
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ad70336ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/evaluate.py
Comment thread src/mailplus_intelligence/scheduler.py
Comment thread src/mailplus_intelligence/cli.py
Kept the sync subcommand (cmd_sync, parser registration, main() dispatch)
introduced on this branch; main had no sync subcommand.

https://claude.ai/code/session_01REVqza82cZP43JoVMgu6jw
@jmcte jmcte merged commit bcd2eaf into main May 6, 2026
8 of 10 checks passed
@jmcte jmcte deleted the claude/close-remaining-issues-pass2 branch May 6, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build metadata and thread index for all MailPlus mail

2 participants